<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/jsp/taglibs.jsp"%>
<html>
  <head>
	<title>公共平台 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<!-- 样式文件的引入 -->
	<link href="${ctx}/commons/css/style.css" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/icon.css">
	<!-- jqueryUI JS文件的引入 -->
	<script type="text/javascript" src="${ctx}/commons/js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="${ctx}/commons/js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${ctx}/commons/js/easyui-extends-validate.js"></script>
	<!-- jqueryUI国际化 -->
	<script type="text/javascript" src="${ctx}/commons/js/easyui-lang-zh_CN.js"></script>
	<!-- 开发使用的公用js方法 -->
	<script type="text/javascript" src="${ctx}/commons/js/common.js"></script>
	<!-- 开发国际化的引用，主要完成后台信息在前台提示的国际化，一定要放在最后 -->
	<script type="text/javascript">var ctx = '${ctx}';var actionExt = "action";var i18n = new Object();</script>
	<script src="${ctx}/commons/js/i18n/message_zh_CN.js" type="text/javascript"></script>
  </head>
  
  <body>
  <!--  <a href="javascript:void(0)" onclick="purchase();" >test</a>-->
    <div class="easyui-layout" data-options="fit:true,border:false" >
		<div data-options="region:'center',border:true">
			<div class="easyui-layout" data-options="fit:true,border:false" >
				<div data-options="region:'north',border:false" style="padding: 4px;height: 50px;overflow: hidden;">
					<div class="easyui-panel" data-options="fit:true,border:true" >
						<div  class="queryContent">
							<form name="search" id="searchHolidayForm" method="post" action="" style="display: none; ">
								<table class="queryTable" >
									<tbody>
										<tr>
											<th width="70%">年份</th>
											<td width="10%"><input class="easyui-validatebox" type="text" name="at_year" maxlength="20" style="width:120px"></input></td>
											<th>假期查询</th>
											<td width="10%">
												<input class="easyui-datebox" type="text" name="at_day" maxlength="30" style="width:120px"></input></td>
											<td align="right" width="10%"><a href="javascript:void(0);" class="easyui-linkbutton" id="searchHoliday"  plain="true">查询</a>
													<a href="javascript:void(0);" class="easyui-linkbutton" id="resetSearchHoliday" plain="true">清空</a></td>
										</tr>
									</tbody>
								</table>
							</form>
						</div>
					</div>
				</div>
			<div data-options="region:'center',border:false" style="padding: 4px;">
		    <table id="listHolidayTable" class="easyui-datagrid" 
				data-options="singleSelect:false,toolbar:'#tb',method:'post',rownumbers:true,fit:true,fitColumns:true,border:true,
					pagination:true,remoteSort:true,multiSort:true,striped:true,
					url:'${ctx}/framework/holidayset/list'"}>
				<thead>
					<tr>
						<th data-options="field:'id',checkbox:true"></th>
						<th data-options="field:'at_day',width:50,sortable:true,title:'日期'" align="center"></th>
						<th data-options="field:'at_year',width:50,title:'年份'" align="center"></th>
						<th data-options="field:'hoilday_type',width:50,title:'类型'" align="center" formatter="formatOper"></th>
						<th data-options="field:'descript',sortable:true,width:50,title:'备注'" align="center"></th>
						<th data-options="field:'updateTime',sortable:true,width:100,title:'创建时间'" align="center"></th>
						<th data-options="field:'create_name',sortable:true,width:50,title:'创建人'" align="center"></th>
					</tr>
				</thead>
			</table>
			<div id="tb" style="display: none;">
				<div>
					<a href="javascript:void(0);" onclick="openDataDialog(paramObj,undefined);" class="easyui-linkbutton" iconCls="icon-add" plain="true">添加</a>
					<a href="javascript:void(0);" onclick="deleteData(paramObj);" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a>
				</div>
			</div>
		</div>
		</div>
		</div>
		<div id="showHolidayDialog"></div>
	</div>
	<script type="text/javascript">
		//初始化表格对应的js对象
		var paramObj;
		$(function() {
			//初始化表格对象数据
			paramObj = new initParams(
					{
						paramObjName : 'holidaySet',//表格对应的实体对象名称，好区分多个表格情况下的对象
						tableId:'listHolidayTable',
						addDataFormId:'addHolidayDataForm',
						showDialogId:'firstLevelDialog',
						searchID:'searchHoliday',
						resetSearchID:'resetSearchHoliday',
						searchFormID:'searchHolidayForm',
						//updateUrl:'${ctx}/framework/holidayset/input?id= ',
						updateUrl:'${ctx}/framework/holiday/holiday-input.jsp',
						deleteUrl:'${ctx}/framework/holidayset/remove',
						addDialogWidth:580,
						addDialogHeight:260,
						ctx:'${ctx}',
						addDialogTitle:'节假日信息'
					});
			//初始化查询
			init(paramObj);				
		});
		
		
		 //弹出签到表
		 function purchase(){
			 window.open("${ctx}/business/professerinfo/print?id=402884905691b67f015691bcb25a0002");
		 }
		 
		 
		 
	     function formatOper(val, row, index) {
				if (row.hoilday_type ==1) {
					return "公休";
				} else if (row.hoilday_type == 2) {
					return "补班";
				}else if (row.hoilday_type == 3){
					return "周末";
				}
			}
			
			$.extend($.fn.validatebox.defaults.rules, {
			    comboVry: {
			        validator: function (value) {//param为默认值
			            return value !="--请选择类型--";
			        },
			        message: '请选择类型'
			    }
			});
	</script>
  </body>
</html>
